<?php
/**
 * Zhub - A PHP Framework For API Developer
 *
 * This file is part of the Zhub package.
 *
 * (c) YiLong Fan <fantiq@163.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @author fanyilong <fantiq@163.com>
 * @copyright 2017 fanyilong. All rights reserved.
 * @package Zhub
 * @date 18-3-6
 */

namespace Tests\DataBase\Table;


use Zhub\DataBase\Tables\Field;
use Zhub\DataBase\Tables\Table;

class UserTable extends Table
{
    const ID = 'id';

    const NAME = 'name';

    const MOBILE = 'mobile';

    public static function initialize(): array
    {
        return [
            self::ID => Field::name('id')->integer(Field::NUM_INT, true)->comment('pk'),
            self::NAME => Field::name('name')->string(Field::STR_VARCHAR, 32)->comment('user name'),
            self::MOBILE => Field::name('mobile')->integer(Field::NUM_INT)->comment('手机号'),
        ];
    }

    public static function tableName(): string
    {
        return self::prefix() . 'user';
    }

    public static function prefix(): string
    {
        return 'kqc_';
    }
}